home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / t2win-32 / _file.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-08-24  |  81.7 KB  |  1,775 lines

  1. VERSION 4.00
  2. Begin VB.Form frmFile 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "File"
  5.    ClientHeight    =   5160
  6.    ClientLeft      =   1485
  7.    ClientTop       =   2415
  8.    ClientWidth     =   7785
  9.    Height          =   5565
  10.    Left            =   1425
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5160
  14.    ScaleWidth      =   7785
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2070
  17.    Width           =   7905
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4425
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7575
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   1
  35.       Top             =   0
  36.       Width           =   7785
  37.       _Version        =   65536
  38.       _ExtentX        =   13732
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   2
  47.          Top             =   90
  48.          Width           =   5100
  49.       End
  50.       Begin Threed.SSCommand cmdNP 
  51.          Height          =   300
  52.          Index           =   1
  53.          Left            =   7455
  54.          TabIndex        =   6
  55.          Top             =   90
  56.          Width           =   255
  57.          _Version        =   65536
  58.          _ExtentX        =   450
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   ">"
  62.          BevelWidth      =   1
  63.          Font3D          =   3
  64.          RoundedCorners  =   0   'False
  65.          Outline         =   0   'False
  66.       End
  67.       Begin Threed.SSCommand cmdNP 
  68.          Height          =   300
  69.          Index           =   0
  70.          Left            =   6615
  71.          TabIndex        =   5
  72.          Top             =   90
  73.          Width           =   255
  74.          _Version        =   65536
  75.          _ExtentX        =   450
  76.          _ExtentY        =   529
  77.          _StockProps     =   78
  78.          Caption         =   "<"
  79.          BevelWidth      =   1
  80.          Font3D          =   3
  81.          RoundedCorners  =   0   'False
  82.          Outline         =   0   'False
  83.       End
  84.       Begin VB.Label Label2 
  85.          Caption         =   "&Select a function"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   4
  89.          Top             =   120
  90.          Width           =   1275
  91.       End
  92.       Begin Threed.SSCommand SSCommand1 
  93.          Default         =   -1  'True
  94.          Height          =   300
  95.          Left            =   6930
  96.          TabIndex        =   3
  97.          Top             =   90
  98.          Width           =   465
  99.          _Version        =   65536
  100.          _ExtentX        =   820
  101.          _ExtentY        =   529
  102.          _StockProps     =   78
  103.          Caption         =   "&Go"
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. Attribute VB_Name = "frmFile"
  110. Attribute VB_Creatable = False
  111. Attribute VB_Exposed = False
  112. Option Explicit
  113. Option Base 1
  114. Private Const Iteration = 10
  115. Dim IsLoaded         As Integer
  116. Dim TimerStartOk     As Integer
  117. Dim TimerCloseOk     As Integer
  118. Dim TimerHandle      As Integer
  119. Dim TimerValue       As Long
  120. Private Sub cmdNP_Click(Index As Integer)
  121.    Call sub_NextPrev(cmb_Function, Index)
  122. End Sub
  123. Private Sub cmb_Function_Click()
  124.    If (IsLoaded = False) Then Exit Sub
  125.    Call cDisableFI(mdiT2W.Picture1)
  126.    txt_Result = ""
  127.    DoEvents
  128.    Select Case cmb_Function.ListIndex
  129.       Case 0
  130.          Call TestAllSubDirectories
  131.       Case 1
  132.          Call TestChDir
  133.       Case 2
  134.          Call TestChDrive
  135.       Case 3
  136.          Call TestFileCompressExpandTab
  137.       Case 4
  138.          Call TestFileCopy
  139.       Case 5
  140.          Call TestFileMove
  141.       Case 6
  142.          Call TestFileFilter
  143.       Case 7
  144.          Call TestFileFilterNot
  145.       Case 8
  146.          Call TestFileSize
  147.       Case 9
  148.          Call TestFileLineCount
  149.       Case 10
  150.          Call TestFileUpperLower
  151.       Case 11
  152.          Call TestFileMerge
  153.       Case 12
  154.          Call TestFileSearchAndReplace
  155.       Case 13
  156.          Call TestFileSearch
  157.       Case 14
  158.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, False)
  159.       Case 15
  160.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, False)
  161.       Case 16
  162.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, False)
  163.       Case 17
  164.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, False)
  165.       Case 18
  166.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, True)
  167.       Case 19
  168.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, True)
  169.       Case 20
  170.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, True)
  171.       Case 21
  172.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, True)
  173.       Case 22
  174.          Call TestFileChangeChars
  175.       Case 23
  176.          Call TestIsFileX
  177.       Case 24
  178.          Call TestKillDir
  179.       Case 25
  180.          Call TestKillDirs
  181.       Case 26
  182.          Call TestGetDiskSpace
  183.       Case 27
  184.          Call TestGetDiskUsed
  185.       Case 28
  186.          Call TestGetDiskFree
  187.       Case 29
  188.          Call TestGetDiskClusterSize
  189.       Case 30
  190.          Call TestCountFiles
  191.       Case 31
  192.          Call TestCountDirectories
  193.       Case 32
  194.          Call TestRcsCountFileDir
  195.       Case 33
  196.          Call TestFilesSizeX
  197.       Case 34
  198.          Call TestRcsFilesSizeX
  199.       Case 35
  200.          Call TestTruncatePath
  201.       Case 36
  202.          Call TestMakeSplitPath
  203.       Case 37
  204.          Call TestFullPath
  205.       Case 38
  206.          Call TestRenameFile
  207.       Case 39
  208.          Call TestUniqueFileName
  209.       Case 40
  210.          Call TestFilesInDirectory
  211.       Case 41
  212.          Call TestSubDirectory
  213.       Case 42
  214.          Call TestFileGetAttribute
  215.       Case 43
  216.          Call TestFileSetAttribute
  217.       Case 44
  218.          Call TestFileSetAllAttributes
  219.       Case 45
  220.          Call TestFileResetAllAttributes
  221.       Case 46
  222.          Call TestFileCompareX
  223.       Case 47
  224.          Call TestFileDrive
  225.       Case 48
  226.          Call TestFilesInDirOnDisk
  227.       Case 49
  228.          Call TestFileDateTime
  229.       Case 50
  230.          Call TestFileStatistics
  231.       Case 51
  232.          Call TestGetDriveType
  233.       Case 52
  234.          Call TestPBFileCopy
  235.       Case 53
  236.          Call TestDBFileCopy
  237.       Case 54
  238.          Call TestFileUUCP
  239.       Case 55
  240.          Call TestOpenFiles(ENUMERATE_ALL_OPEN_FILES)
  241.       Case 56
  242.          Call TestOpenFiles(ENUMERATE_ONLY_OPEN_UNMOVABLE_FILES)
  243.    End Select
  244.    DoEvents
  245.    Call cEnableFI(mdiT2W.Picture1)
  246. End Sub
  247. Private Sub Form_Activate()
  248.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  249. End Sub
  250. Private Sub Form_Load()
  251.    IsLoaded = False
  252.    Show
  253.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_file.t2w")
  254.    IsLoaded = True
  255. End Sub
  256. Private Sub SSCommand1_Click()
  257.    Call cmb_Function_Click
  258. End Sub
  259. Private Sub TestAllSubDirectories()
  260.    Dim intResult        As Integer
  261.    Dim strResult        As String
  262.    Dim strDisplay       As String
  263.    Dim i                As Long
  264.    strResult = ""
  265.    strDisplay = ""
  266.    i = -1
  267.    TimerHandle = cTimerOpen()
  268.    TimerStartOk = cTimerStart(TimerHandle)
  269.    strResult = cAllSubDirectories("C:", i)
  270.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  271.    TimerCloseOk = cTimerClose(TimerHandle)
  272.    strResult = cStringSAR(strResult, vbCr, vbCrLf, False)
  273.    strDisplay = "Directories founden on drive C are " & i & vbCrLf & vbCrLf & strResult
  274.    txt_Result = strDisplay
  275. End Sub
  276. Private Sub TestChDir()
  277.    Dim intResult        As Integer
  278.    Dim strResult        As String
  279.    Dim strDisplay       As String
  280.    Dim i                As Integer
  281.    strResult = ""
  282.    strDisplay = ""
  283.    For i = 1 To 26
  284.       intResult = cChDir(Chr$(64 + i) & ":\")
  285.       If (intResult = True) Then
  286.          strDisplay = strDisplay & "ChDir to \ on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  287.       End If
  288.    Next i
  289.      
  290.    txt_Result = strDisplay
  291.    'time the function
  292.    TimerHandle = cTimerOpen()
  293.    TimerStartOk = cTimerStart(TimerHandle)
  294.    For i = 1 To Iteration
  295.       intResult = cChDir("C:\")
  296.    Next i
  297.    intResult = cChDir(T2WDirTest)
  298.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  299.    TimerCloseOk = cTimerClose(TimerHandle)
  300. End Sub
  301. Private Sub TestChDrive()
  302.    Dim intResult        As Integer
  303.    Dim strResult        As String
  304.    Dim strDisplay       As String
  305.    Dim i                As Integer
  306.    strResult = ""
  307.    strDisplay = ""
  308.    For i = 1 To 26
  309.       intResult = cChDrive(Chr$(64 + i))
  310.       If (intResult = True) Then
  311.          strDisplay = strDisplay & "ChDrive on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  312.       End If
  313.    Next i
  314.    txt_Result = strDisplay
  315.    'time the function
  316.    TimerHandle = cTimerOpen()
  317.    TimerStartOk = cTimerStart(TimerHandle)
  318.    For i = 1 To Iteration
  319.       intResult = cChDrive("C")
  320.    Next i
  321.    intResult = cChDrive(T2WDirTest)
  322.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  323.    TimerCloseOk = cTimerClose(TimerHandle)
  324. End Sub
  325. Private Sub TestFileCompressExpandTab()
  326.    Dim lngResult        As Long
  327.    Dim strResult        As String
  328.    Dim strDisplay       As String
  329.    Dim i                As Long
  330.    Dim File1            As String
  331.    Dim File2            As String
  332.    Dim File3            As String
  333.    strResult = ""
  334.    strDisplay = ""
  335.    File1 = T2WFileTest
  336.    File2 = "autoexec.tabcompressed"
  337.    File3 = "autoexec.tabexpanded"
  338.    For i = 1 To 4
  339.       strDisplay = strDisplay & "File CompressTab (" & i & " spaces = 1 tab) " & File1 & " to " & File2 & " is " & cFileCompressTab(File1, File2, i) & vbCrLf
  340.       strDisplay = strDisplay & "File ExpandTab (" & i & " spaces = 1 tab) " & File2 & " to " & File3 & " is " & cFileExpandTab(File2, File3, i) & vbCrLf
  341.       strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  342.    Next i
  343.    txt_Result = strDisplay
  344.    'time the function
  345.    TimerHandle = cTimerOpen()
  346.    TimerStartOk = cTimerStart(TimerHandle)
  347.    For i = 1 To Iteration
  348.       lngResult = cFileExpandTab(File1, File2, 3)
  349.    Next i
  350.    lngResult = cFileCompressTab(File2, File3, 3)
  351.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  352.    TimerCloseOk = cTimerClose(TimerHandle)
  353. End Sub
  354. Private Sub TestFileCopy()
  355.    Dim lngResult        As Long
  356.    Dim strResult        As String
  357.    Dim strDisplay       As String
  358.    Dim i                As Long
  359.    Dim File1            As String
  360.    Dim File2            As String
  361.    strResult = ""
  362.    strDisplay = ""
  363.    File1 = T2WFileTest
  364.    File2 = "autoexec.copy"
  365.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  366.    strDisplay = strDisplay & "File Copy2 '" & File1 & "' to '" & File2 & "' is " & cFileCopy2(File1, File2) & vbCrLf & vbCrLf
  367.    txt_Result = strDisplay
  368.    'time the function
  369.    TimerHandle = cTimerOpen()
  370.    TimerStartOk = cTimerStart(TimerHandle)
  371.    For i = 1 To Iteration
  372.       lngResult = cFileCopy(File1, File2)
  373.    Next i
  374.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  375.    TimerCloseOk = cTimerClose(TimerHandle)
  376. End Sub
  377. Private Sub TestFileMove()
  378.    Dim lngResult        As Long
  379.    Dim strResult        As String
  380.    Dim strDisplay       As String
  381.    Dim i                As Long
  382.    Dim File1            As String
  383.    Dim File2            As String
  384.    strResult = ""
  385.    strDisplay = ""
  386.    File1 = T2WFileTest
  387.    File2 = "c:\win95\autoexec.bat"
  388.    strDisplay = strDisplay & "File Move '" & File1 & "' to '" & File2 & "' is " & cFileMove(File1, File2) & vbCrLf & vbCrLf
  389.    txt_Result = strDisplay
  390.    'time the function
  391.    TimerHandle = cTimerOpen()
  392.    TimerStartOk = cTimerStart(TimerHandle)
  393.    For i = 1 To Iteration
  394.       lngResult = cFileMove(File1, File2)
  395.    Next i
  396.    lngResult = cFileCopy(File2, File1)
  397.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  398.    TimerCloseOk = cTimerClose(TimerHandle)
  399. End Sub
  400. Private Sub TestFileFilter()
  401.    Dim lngResult        As Long
  402.    Dim strResult        As String
  403.    Dim strDisplay       As String
  404.    Dim i                As Long
  405.    Dim File1            As String
  406.    Dim File2            As String
  407.    Dim Filter           As String
  408.    strResult = ""
  409.    strDisplay = ""
  410.    MsgBox T2WFileTest
  411.    File1 = T2WFileTest
  412.    File2 = "autoexec.filter"
  413.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  414.    Filter = Filter + LCase$(Filter)
  415.    strDisplay = strDisplay & "File Filter (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  416.    txt_Result = strDisplay
  417.    'time the function
  418.    TimerHandle = cTimerOpen()
  419.    TimerStartOk = cTimerStart(TimerHandle)
  420.    For i = 1 To Iteration
  421.       lngResult = cFileFilter(File1, File2, Filter)
  422.    Next i
  423.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  424.    TimerCloseOk = cTimerClose(TimerHandle)
  425. End Sub
  426. Private Sub TestFileFilterNot()
  427.    Dim lngResult        As Long
  428.    Dim strResult        As String
  429.    Dim strDisplay       As String
  430.    Dim i                As Long
  431.    Dim File1            As String
  432.    Dim File2            As String
  433.    Dim Filter           As String
  434.    strResult = ""
  435.    strDisplay = ""
  436.    File1 = T2WFileTest
  437.    File2 = "autoexec.filternot"
  438.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  439.    Filter = Filter + LCase$(Filter)
  440.    strDisplay = strDisplay & "File Filter Not (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  441.    txt_Result = strDisplay
  442.    'time the function
  443.    TimerHandle = cTimerOpen()
  444.    TimerStartOk = cTimerStart(TimerHandle)
  445.    For i = 1 To Iteration
  446.       lngResult = cFileFilterNot(File1, File2, Filter)
  447.    Next i
  448.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  449.    TimerCloseOk = cTimerClose(TimerHandle)
  450. End Sub
  451. Private Sub TestFileSize()
  452.    Dim lngResult        As Long
  453.    Dim strResult        As String
  454.    Dim strDisplay       As String
  455.    Dim i                As Long
  456.    Dim File1            As String
  457.    Dim File2            As String
  458.    strResult = ""
  459.    strDisplay = ""
  460.    File1 = T2WFileTest
  461.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  462.    File1 = "c:\autoexec.bat"
  463.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  464.    File1 = "c:\config.sys"
  465.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  466.    File1 = "c:\test.tst"
  467.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  468.    File1 = "c:\command.com"
  469.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  470.    txt_Result = strDisplay
  471.    'time the function
  472.    TimerHandle = cTimerOpen()
  473.    TimerStartOk = cTimerStart(TimerHandle)
  474.    For i = 1 To Iteration
  475.       lngResult = cFileSize(File1)
  476.    Next i
  477.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  478.    TimerCloseOk = cTimerClose(TimerHandle)
  479. End Sub
  480. Private Sub TestFileLineCount()
  481.    Dim lngResult        As Long
  482.    Dim strResult        As String
  483.    Dim strDisplay       As String
  484.    Dim i                As Long
  485.    Dim File1            As String
  486.    Dim File2            As String
  487.    strResult = ""
  488.    strDisplay = ""
  489.    File1 = T2WFileTest
  490.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  491.    File1 = "c:\autoexec.bat"
  492.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  493.    File1 = "c:\config.sys"
  494.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  495.    File1 = "c:\test.tst"
  496.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  497.    File1 = "c:\command.com"
  498.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  499.    txt_Result = strDisplay
  500.    'time the function
  501.    TimerHandle = cTimerOpen()
  502.    TimerStartOk = cTimerStart(TimerHandle)
  503.    For i = 1 To Iteration
  504.       lngResult = cFileLineCount(File1)
  505.    Next i
  506.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  507.    TimerCloseOk = cTimerClose(TimerHandle)
  508. End Sub
  509. Public Sub TestFileUpperLower()
  510.    Dim lngResult        As Long
  511.    Dim strResult        As String
  512.    Dim strDisplay       As String
  513.    Dim i                As Long
  514.    Dim File1            As String
  515.    Dim File2            As String
  516.    Dim File3            As String
  517.    strResult = ""
  518.    strDisplay = ""
  519.    File1 = T2WFileTest
  520.    File2 = "autoexec.toupper"
  521.    File3 = "autoexec.tolower"
  522.    strDisplay = strDisplay & "File to upper '" & File1 & "' to '" & File2 & "' is " & cFileToUpper(File1, File2) & vbCrLf & vbCrLf
  523.    strDisplay = strDisplay & "File to lower '" & File1 & "' to '" & File3 & "' is " & cFileToLower(File1, File3) & vbCrLf & vbCrLf
  524.    txt_Result = strDisplay
  525.    'time the function
  526.    TimerHandle = cTimerOpen()
  527.    TimerStartOk = cTimerStart(TimerHandle)
  528.    For i = 1 To Iteration
  529.       lngResult = cFileToUpper(File1, File2)
  530.    Next i
  531.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  532.    TimerCloseOk = cTimerClose(TimerHandle)
  533. End Sub
  534. Private Sub TestFileMerge()
  535.    Dim lngResult        As Long
  536.    Dim strResult        As String
  537.    Dim strDisplay       As String
  538.    Dim i                As Long
  539.    Dim File1            As String
  540.    Dim File2            As String
  541.    Dim File3            As String
  542.    strResult = ""
  543.    strDisplay = ""
  544.    File1 = T2WFileTest
  545.    File2 = "c:\config.sys"
  546.    File3 = "autoexec.merged"
  547.    strDisplay = strDisplay & "File Merge '" & File1 & "' and '" & File2 & "' to '" & File3 & "' is " & cFileMerge(File1, File2, File3) & vbCrLf & vbCrLf
  548.    txt_Result = strDisplay
  549.    'time the function
  550.    TimerHandle = cTimerOpen()
  551.    TimerStartOk = cTimerStart(TimerHandle)
  552.    For i = 1 To Iteration
  553.       lngResult = cFileMerge(File1, File2, File3)
  554.    Next i
  555.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  556.    TimerCloseOk = cTimerClose(TimerHandle)
  557. End Sub
  558. Private Sub TestFileSearchAndReplace()
  559.    Dim lngResult        As Long
  560.    Dim strResult        As String
  561.    Dim strDisplay       As String
  562.    Dim i                As Long
  563.    Dim File1            As String
  564.    Dim File2            As String
  565.    Dim Search           As String
  566.    Dim Replace          As String
  567.    strResult = ""
  568.    strDisplay = ""
  569.    File1 = T2WFileTest
  570.    File2 = "autoexec.searchandreplace"
  571.    Search = "rem SET "
  572.    Replace = "REM set "
  573.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  574.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Search & "' -> '" & Replace & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Search, Replace, "tmp.tmp", True) & vbCrLf & vbCrLf
  575.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Replace & "' -> '" & Search & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Replace, Search, "tmp.tmp", True) & vbCrLf & vbCrLf
  576.    strDisplay = strDisplay & "Compare file contents (insensitive) '" & File2 & "' with '" & File1 & "' is " & IIf(cCmpFileContents(File2, File1, False) = True, "same", "not same") & vbCrLf & vbCrLf
  577.    txt_Result = strDisplay
  578.    'time the function
  579.    TimerHandle = cTimerOpen()
  580.    TimerStartOk = cTimerStart(TimerHandle)
  581.    For i = 1 To Iteration
  582.       If ((i Mod 2) = 1) Then
  583.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  584.       Else
  585.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  586.       End If
  587.    Next i
  588.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  589.    TimerCloseOk = cTimerClose(TimerHandle)
  590. End Sub
  591. Private Sub TestFileSearch()
  592.    Dim lngResult        As Long
  593.    Dim strResult        As String
  594.    Dim strDisplay       As String
  595.    Dim i                As Long
  596.    Dim File1            As String
  597.    Dim Search1          As String
  598.    Dim Search2          As String
  599.    strResult = ""
  600.    strDisplay = ""
  601.    File1 = T2WFileTest
  602.    Search1 = "re"
  603.    Search2 = "SET"
  604.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, False) & vbCrLf & vbCrLf
  605.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, False) & vbCrLf & vbCrLf
  606.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, False) & vbCrLf & vbCrLf
  607.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, False) & vbCrLf & vbCrLf
  608.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, True) & vbCrLf & vbCrLf
  609.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, True) & vbCrLf & vbCrLf
  610.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, True) & vbCrLf & vbCrLf
  611.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, True) & vbCrLf & vbCrLf
  612.    txt_Result = strDisplay
  613.    'time the function
  614.    TimerHandle = cTimerOpen()
  615.    TimerStartOk = cTimerStart(TimerHandle)
  616.    For i = 1 To Iteration
  617.       If ((i Mod 2) = 1) Then
  618.          lngResult = cFileSearch(File1, Search1, False)
  619.       Else
  620.          lngResult = cFileSearchCount(File1, Search2, False)
  621.       End If
  622.    Next i
  623.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  624.    TimerCloseOk = cTimerClose(TimerHandle)
  625. End Sub
  626. Private Sub TestFileSort(intSortMethod As Integer, intVarFix As Integer)
  627.    Dim lngResult        As Long
  628.    Dim strResult        As String
  629.    Dim strDisplay       As String
  630.    Dim i                As Long
  631.    Dim n                As Long
  632.    Dim File1            As String
  633.    Dim File2            As String
  634.    strResult = ""
  635.    strDisplay = ""
  636.    File1 = T2WFileTest
  637.    File2 = "autoexec.sort" & intSortMethod & Abs(intVarFix)
  638.    strDisplay = "The 7 first lines in '" & File1 & "' before sorting are " & vbCrLf & vbCrLf
  639.    Close #1
  640.    Open File1 For Input Shared As #1
  641.    For i = 1 To 7
  642.       Line Input #1, strResult
  643.       strDisplay = strDisplay + strResult + vbCrLf
  644.    Next i
  645.    Close #1
  646.    If (intVarFix = False) Then
  647.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  648.    Else
  649.       lngResult = cFileSort(File1, File2, intSortMethod, 7, 0, 7, n)
  650.    End If
  651.    strDisplay = strDisplay + vbCrLf
  652.    strDisplay = strDisplay + "The 7 first lines in '" & File2 & "' after sorting are " & vbCrLf & vbCrLf
  653.    Close #1
  654.    Open File2 For Input Shared As #1
  655.    For i = 1 To 7
  656.       Line Input #1, strResult
  657.       strDisplay = strDisplay + strResult + vbCrLf
  658.    Next i
  659.    Close #1
  660.    strDisplay = strDisplay + vbCrLf
  661.    Select Case intSortMethod
  662.       Case (SORT_ASCENDING + SORT_CASE_SENSITIVE):
  663.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and CS is '" & lngResult & "' and records are '" & n & "'"
  664.       Case (SORT_DESCENDING + SORT_CASE_SENSITIVE):
  665.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and CS is '" & lngResult & "' and records are '" & n & "'"
  666.       Case (SORT_ASCENDING + SORT_CASE_INSENSITIVE):
  667.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and NS is '" & lngResult & "' and records are '" & n & "'"
  668.       Case (SORT_DESCENDING + SORT_CASE_INSENSITIVE):
  669.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and NS is '" & lngResult & "' and records are '" & n & "'"
  670.    End Select
  671.    txt_Result = strDisplay
  672.    'time the function
  673.    TimerHandle = cTimerOpen()
  674.    TimerStartOk = cTimerStart(TimerHandle)
  675.    For i = 1 To Iteration
  676.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  677.    Next i
  678.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  679.    TimerCloseOk = cTimerClose(TimerHandle)
  680. End Sub
  681. Private Sub TestFileChangeChars()
  682.    Dim lngResult        As Long
  683.    Dim strResult        As String
  684.    Dim strDisplay       As String
  685.    Dim i                As Long
  686.    Dim File1            As String
  687.    Dim File2            As String
  688.    Dim Change1          As String
  689.    Dim Change2          As String
  690.    strResult = ""
  691.    strDisplay = ""
  692.    File1 = T2WFileTest
  693.    File2 = "autoexec.changechars"
  694.    Change1 = "REM"
  695.    Change2 = "mer"
  696.    txt_Result = strDisplay
  697.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  698.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' before change are " & vbCrLf & vbCrLf
  699.    Close #1
  700.    Open File2 For Input Shared As #1
  701.    For i = 1 To 7
  702.       Line Input #1, strResult
  703.       strDisplay = strDisplay + strResult + vbCrLf
  704.    Next i
  705.    Close #1
  706.    strDisplay = strDisplay + vbCrLf
  707.    strDisplay = strDisplay & "File Change Chars : '" & Change1 & "' -> '" & Change2 & "' in '" & File2 & "' is " & cFileChangeChars(File2, Change1, Change2, "file1.file1") & vbCrLf & vbCrLf
  708.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' after change are " & vbCrLf & vbCrLf
  709.    Close #1
  710.    Open File2 For Input Shared As #1
  711.    For i = 1 To 7
  712.       Line Input #1, strResult
  713.       strDisplay = strDisplay + strResult + vbCrLf
  714.    Next i
  715.    Close #1
  716.    txt_Result = strDisplay
  717.    'time the function
  718.    TimerHandle = cTimerOpen()
  719.    TimerStartOk = cTimerStart(TimerHandle)
  720.    For i = 1 To Iteration
  721.       If ((i Mod 2) = 1) Then
  722.          lngResult = cFileChangeChars(File2, Change1, Change2, "")
  723.       Else
  724.          lngResult = cFileChangeChars(File2, Change2, Change1, "")
  725.       End If
  726.    Next i
  727.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  728.    TimerCloseOk = cTimerClose(TimerHandle)
  729. End Sub
  730. Private Sub TestIsFileX()
  731.    Dim intResult        As Integer
  732.    Dim strResult        As String
  733.    Dim strDisplay       As String
  734.    Dim i                As Integer
  735.    Dim File1            As String
  736.    strResult = ""
  737.    strDisplay = ""
  738.    File1 = T2WFileTest
  739.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  740.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  741.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  742.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  743.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  744.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  745.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  746.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  747.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  748.      
  749.    File1 = cGetWindowsDirectory() & "\user.dat"
  750.    strDisplay = strDisplay & vbCrLf
  751.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  752.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  753.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  754.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  755.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  756.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  757.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  758.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  759.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  760.      
  761.    txt_Result = strDisplay
  762.    'time the function
  763.    TimerHandle = cTimerOpen()
  764.    TimerStartOk = cTimerStart(TimerHandle)
  765.    For i = 1 To Iteration
  766.       intResult = cIsFilenameValid(File1)
  767.    Next i
  768.    intResult = cChDir(T2WDirTest)
  769.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  770.    TimerCloseOk = cTimerClose(TimerHandle)
  771. End Sub
  772. Private Sub TestKillDir()
  773.    Dim intResult        As Integer
  774.    Dim strResult        As String
  775.    Dim strDisplay       As String
  776.    Dim i                As Integer
  777.    Dim File1            As String
  778.    strResult = ""
  779.    strDisplay = ""
  780.    File1 = "c:\this is a test for KillDir"
  781.    intResult = cMakeDir(File1)
  782.    strDisplay = strDisplay & "Directory '" & File1 & "' is created" & vbCrLf & vbCrLf
  783.    strDisplay = strDisplay & "Directory '" & File1 & "' is " & IIf(cKillDir(File1) = True, "deleted", "not deleted") & vbCrLf & vbCrLf
  784.      
  785.    txt_Result = strDisplay
  786.    'time the function
  787.    TimerHandle = cTimerOpen()
  788.    TimerStartOk = cTimerStart(TimerHandle)
  789.    For i = 1 To Iteration
  790.       intResult = cKillDir(File1)
  791.    Next i
  792.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  793.    TimerCloseOk = cTimerClose(TimerHandle)
  794. End Sub
  795. Private Sub TestKillDirs()
  796.    Dim intResult        As Integer
  797.    Dim strResult        As String
  798.    Dim strDisplay       As String
  799.    Dim i                As Integer
  800.    Dim File1            As String
  801.    strResult = ""
  802.    strDisplay = ""
  803.    File1 = "c:\this1\this2\this3\this4"
  804.    intResult = cMakeMultipleDir(File1)
  805.    strDisplay = strDisplay & "Directories '" & File1 & "' are created" & vbCrLf & vbCrLf
  806.    strDisplay = strDisplay & "Directories '" & File1 & "' are " & IIf(cKillDirs("c:\this1", True) > 0, "deleted", "not deleted") & vbCrLf & vbCrLf
  807.      
  808.    txt_Result = strDisplay
  809.    'time the function
  810.    TimerHandle = cTimerOpen()
  811.    TimerStartOk = cTimerStart(TimerHandle)
  812.    For i = 1 To Iteration
  813.       intResult = cKillDirs(File1, True)
  814.    Next i
  815.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  816.    TimerCloseOk = cTimerClose(TimerHandle)
  817. End Sub
  818. Private Sub TestGetDiskSpace()
  819.    Dim lngResult        As Long
  820.    Dim strResult        As String
  821.    Dim strDisplay       As String
  822.    Dim i                As Integer
  823.    strResult = ""
  824.    strDisplay = ""
  825.    For i = 1 To 26
  826.       lngResult = cGetDiskSpace(Chr$(64 + i))
  827.       If (lngResult <> True) Then
  828.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  829.       End If
  830.    Next i
  831.      
  832.    txt_Result = strDisplay
  833.    'time the function
  834.    TimerHandle = cTimerOpen()
  835.    TimerStartOk = cTimerStart(TimerHandle)
  836.    For i = 1 To Iteration
  837.       lngResult = cGetDiskSpace("C")
  838.    Next i
  839.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  840.    TimerCloseOk = cTimerClose(TimerHandle)
  841. End Sub
  842. Private Sub TestGetDiskUsed()
  843.    Dim lngResult        As Long
  844.    Dim strResult        As String
  845.    Dim strDisplay       As String
  846.    Dim i                As Integer
  847.    strResult = ""
  848.    strDisplay = ""
  849.    For i = 1 To 26
  850.       lngResult = cGetDiskUsed(Chr$(64 + i))
  851.       If (lngResult <> True) Then
  852.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  853.       End If
  854.    Next i
  855.      
  856.    txt_Result = strDisplay
  857.    'time the function
  858.    TimerHandle = cTimerOpen()
  859.    TimerStartOk = cTimerStart(TimerHandle)
  860.    For i = 1 To Iteration
  861.       lngResult = cGetDiskUsed("C")
  862.    Next i
  863.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  864.    TimerCloseOk = cTimerClose(TimerHandle)
  865. End Sub
  866. Private Sub TestGetDiskFree()
  867.    Dim lngResult        As Long
  868.    Dim strResult        As String
  869.    Dim strDisplay       As String
  870.    Dim i                As Integer
  871.    strResult = ""
  872.    strDisplay = ""
  873.    For i = 1 To 26
  874.       lngResult = cGetDiskFree(Chr$(64 + i))
  875.       If (lngResult <> True) Then
  876.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  877.       End If
  878.    Next i
  879.      
  880.    txt_Result = strDisplay
  881.    'time the function
  882.    TimerHandle = cTimerOpen()
  883.    TimerStartOk = cTimerStart(TimerHandle)
  884.    For i = 1 To Iteration
  885.       lngResult = cGetDiskFree("C")
  886.    Next i
  887.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  888.    TimerCloseOk = cTimerClose(TimerHandle)
  889. End Sub
  890. Private Sub TestGetDiskClusterSize()
  891.    Dim lngResult        As Long
  892.    Dim strResult        As String
  893.    Dim strDisplay       As String
  894.    Dim i                As Integer
  895.    strResult = ""
  896.    strDisplay = ""
  897.    For i = 1 To 26
  898.       lngResult = cGetDiskClusterSize(Chr$(64 + i))
  899.       If (lngResult <> True) Then
  900.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  901.       End If
  902.    Next i
  903.      
  904.    txt_Result = strDisplay
  905.    'time the function
  906.    TimerHandle = cTimerOpen()
  907.    TimerStartOk = cTimerStart(TimerHandle)
  908.    For i = 1 To Iteration
  909.       lngResult = cGetDiskClusterSize("C")
  910.    Next i
  911.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  912.    TimerCloseOk = cTimerClose(TimerHandle)
  913. End Sub
  914. Private Sub TestRcsCountFileDir()
  915.    Dim lngResult        As Long
  916.    Dim strResult        As String
  917.    Dim strDisplay       As String
  918.    Dim i                As Integer
  919.    strResult = ""
  920.    strDisplay = ""
  921.    strDisplay = strDisplay & "Total directories in C: is " & cRcsCountFileDir(False, "C:", "", True) & vbCrLf
  922.    strDisplay = strDisplay & "Total directories in D: is " & cRcsCountFileDir(False, "D:", "", True) & vbCrLf
  923.    strDisplay = strDisplay & vbCrLf
  924.    strDisplay = strDisplay & "Total files in C: is " & cRcsCountFileDir(True, "C:", "", True) & vbCrLf
  925.    strDisplay = strDisplay & "Total files in D: is " & cRcsCountFileDir(True, "D:", "", True) & vbCrLf
  926.    strDisplay = strDisplay & vbCrLf
  927.    strDisplay = strDisplay & "Total files in C:*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", True) & vbCrLf
  928.    strDisplay = strDisplay & "Total files in D:*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", True) & vbCrLf
  929.    strDisplay = strDisplay & vbCrLf
  930.    strDisplay = strDisplay & "Total directories in C:\ is " & cRcsCountFileDir(False, "C:", "", False) & vbCrLf
  931.    strDisplay = strDisplay & "Total directories in D:\ is " & cRcsCountFileDir(False, "D:", "", False) & vbCrLf
  932.    strDisplay = strDisplay & vbCrLf
  933.    strDisplay = strDisplay & "Total files in C:\ is " & cRcsCountFileDir(True, "C:", "", False) & vbCrLf
  934.    strDisplay = strDisplay & "Total files in D:\ is " & cRcsCountFileDir(True, "D:", "", False) & vbCrLf
  935.    strDisplay = strDisplay & vbCrLf
  936.    strDisplay = strDisplay & "Total files in C:\*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", False) & vbCrLf
  937.    strDisplay = strDisplay & "Total files in D:\*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", False) & vbCrLf
  938.    txt_Result = strDisplay
  939.    'time the function
  940.    TimerHandle = cTimerOpen()
  941.    TimerStartOk = cTimerStart(TimerHandle)
  942.    For i = 1 To Iteration
  943.       lngResult = cRcsCountFileDir(False, "C:", "", False)
  944.    Next i
  945.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  946.    TimerCloseOk = cTimerClose(TimerHandle)
  947. End Sub
  948. Private Sub TestCountFiles()
  949.    Dim lngResult        As Long
  950.    Dim strResult        As String
  951.    Dim strDisplay       As String
  952.    Dim i                As Integer
  953.    strResult = ""
  954.    strDisplay = ""
  955.    strDisplay = strDisplay & "Number of files in C:\ is " & cCountFiles("C:\*.*") & vbCrLf & vbCrLf
  956.    strDisplay = strDisplay & "Number of files in D:\ is " & cCountFiles("D:\*.*") & vbCrLf & vbCrLf
  957.    strDisplay = strDisplay & "Number of files in E:\ is " & cCountFiles("E:\*.*") & vbCrLf & vbCrLf
  958.    txt_Result = strDisplay
  959.    'time the function
  960.    TimerHandle = cTimerOpen()
  961.    TimerStartOk = cTimerStart(TimerHandle)
  962.    For i = 1 To Iteration
  963.       lngResult = cCountFiles("C:\*.*")
  964.    Next i
  965.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  966.    TimerCloseOk = cTimerClose(TimerHandle)
  967. End Sub
  968. Private Sub TestCountDirectories()
  969.    Dim lngResult        As Long
  970.    Dim strResult        As String
  971.    Dim strDisplay       As String
  972.    Dim i                As Integer
  973.    strResult = ""
  974.    strDisplay = ""
  975.    strDisplay = strDisplay & "Number of directories in C:\ is " & cCountDirectories("C:\*.*") & vbCrLf & vbCrLf
  976.    strDisplay = strDisplay & "Number of directories in D:\ is " & cCountDirectories("D:\*.*") & vbCrLf & vbCrLf
  977.    strDisplay = strDisplay & "Number of directories in E:\ is " & cCountDirectories("E:\*.*") & vbCrLf & vbCrLf
  978.    txt_Result = strDisplay
  979.    'time the function
  980.    TimerHandle = cTimerOpen()
  981.    TimerStartOk = cTimerStart(TimerHandle)
  982.    For i = 1 To Iteration
  983.       lngResult = cCountDirectories("C:\*.*")
  984.    Next i
  985.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  986.    TimerCloseOk = cTimerClose(TimerHandle)
  987. End Sub
  988. Private Sub TestFilesSizeX()
  989.    Dim lngResult        As Long
  990.    Dim strResult        As String
  991.    Dim strDisplay       As String
  992.    Dim i                As Long
  993.    Dim Size1            As Double
  994.    Dim Size2            As Double
  995.    strResult = ""
  996.    strDisplay = ""
  997.    strDisplay = strDisplay & "Size of files c:\*.* is " & cFilesSize("c:\*.*") & vbCrLf
  998.    strDisplay = strDisplay & "Size of files c:\*.bat is " & cFilesSize("c:\*.bat") & vbCrLf
  999.    strDisplay = strDisplay & "Size of files c:\*.sys is " & cFilesSize("c:\*.sys") & vbCrLf
  1000.    strDisplay = strDisplay & "Size of files c:\*.com is " & cFilesSize("c:\*.com") & vbCrLf
  1001.    strDisplay = strDisplay & vbCrLf
  1002.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cFilesSizeOnDisk("c:\*.*") & vbCrLf
  1003.    strDisplay = strDisplay & "Size of files c:\*.bat on disk is " & cFilesSizeOnDisk("c:\*.bat") & vbCrLf
  1004.    strDisplay = strDisplay & "Size of files c:\*.sys on disk is " & cFilesSizeOnDisk("c:\*.sys") & vbCrLf
  1005.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cFilesSizeOnDisk("c:\*.com") & vbCrLf
  1006.    strDisplay = strDisplay & vbCrLf
  1007.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cFilesSlack("c:\*.*", Size1, Size2) & " %" & vbCrLf
  1008.    strDisplay = strDisplay & "Slack of files c:\*.bat on disk is " & cFilesSlack("c:\*.bat", Size1, Size2) & " %" & vbCrLf
  1009.    strDisplay = strDisplay & "Slack of files c:\*.sys on disk is " & cFilesSlack("c:\*.sys", Size1, Size2) & " %" & vbCrLf
  1010.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cFilesSlack("c:\*.com", Size1, Size2) & " %" & vbCrLf
  1011.    txt_Result = strDisplay
  1012.    'time the function
  1013.    TimerHandle = cTimerOpen()
  1014.    TimerStartOk = cTimerStart(TimerHandle)
  1015.    For i = 1 To Iteration
  1016.       lngResult = cFilesSize("c:\*.*")
  1017.    Next i
  1018.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1019.    TimerCloseOk = cTimerClose(TimerHandle)
  1020. End Sub
  1021. Private Sub TestRcsFilesSizeX()
  1022.    Dim lngResult        As Long
  1023.    Dim strResult        As String
  1024.    Dim strDisplay       As String
  1025.    Dim i                As Long
  1026.    Dim Size1            As Double
  1027.    Dim Size2            As Double
  1028.    strResult = ""
  1029.    strDisplay = ""
  1030.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", False) & vbCrLf
  1031.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", False) & vbCrLf
  1032.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", False) & vbCrLf
  1033.    strDisplay = strDisplay & vbCrLf
  1034.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", False) & vbCrLf
  1035.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", False) & vbCrLf
  1036.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", False) & vbCrLf
  1037.    strDisplay = strDisplay & vbCrLf
  1038.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", False, Size1, Size2) & " %" & vbCrLf
  1039.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", False, Size1, Size2) & " %" & vbCrLf
  1040.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", False, Size1, Size2) & " %" & vbCrLf
  1041.    strDisplay = strDisplay & vbCrLf
  1042.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", True) & vbCrLf
  1043.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", True) & vbCrLf
  1044.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", True) & vbCrLf
  1045.    strDisplay = strDisplay & vbCrLf
  1046.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", True) & vbCrLf
  1047.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", True) & vbCrLf
  1048.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", True) & vbCrLf
  1049.    strDisplay = strDisplay & vbCrLf
  1050.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", True, Size1, Size2) & " %" & vbCrLf
  1051.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", True, Size1, Size2) & " %" & vbCrLf
  1052.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", True, Size1, Size2) & " %" & vbCrLf
  1053.    txt_Result = strDisplay
  1054.    'time the function
  1055.    TimerHandle = cTimerOpen()
  1056.    TimerStartOk = cTimerStart(TimerHandle)
  1057.    For i = 1 To Iteration
  1058.       lngResult = cRcsFilesSize("c:\", "*.*", False)
  1059.    Next i
  1060.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1061.    TimerCloseOk = cTimerClose(TimerHandle)
  1062. End Sub
  1063. Private Sub TestTruncatePath()
  1064.    Dim intResult        As Integer
  1065.    Dim strResult        As String
  1066.    Dim strDisplay       As String
  1067.    Dim i                As Integer
  1068.    Dim File1            As String
  1069.    strResult = ""
  1070.    strDisplay = ""
  1071.    strDisplay = strDisplay & "Truncate the following path with a length of 25" & vbCrLf & vbCrLf
  1072.    File1 = "t2win-16.bas"
  1073.    strResult = cTruncatePath(File1, 25)
  1074.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1075.    File1 = "windows\system\t2win-16.bas"
  1076.    strResult = cTruncatePath(File1, 25)
  1077.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1078.    File1 = "c:\win95\system\t2win-16.bas"
  1079.    strResult = cTruncatePath(File1, 25)
  1080.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1081.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1082.    strResult = cTruncatePath(File1, 25)
  1083.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1084.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1085.    strResult = cTruncatePath(File1, 25)
  1086.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1087.    strDisplay = strDisplay & "Truncate the following path with a length of 35" & vbCrLf & vbCrLf
  1088.    File1 = "t2win-16.bas"
  1089.    strResult = cTruncatePath(File1, 35)
  1090.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1091.    File1 = "windows\system\t2win-16.bas"
  1092.    strResult = cTruncatePath(File1, 35)
  1093.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1094.    File1 = "c:\win95\system\t2win-16.bas"
  1095.    strResult = cTruncatePath(File1, 35)
  1096.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1097.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1098.    strResult = cTruncatePath(File1, 35)
  1099.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1100.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1101.    strResult = cTruncatePath(File1, 35)
  1102.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1103.      
  1104.    txt_Result = strDisplay
  1105.    'time the function
  1106.    TimerHandle = cTimerOpen()
  1107.    TimerStartOk = cTimerStart(TimerHandle)
  1108.    For i = 1 To Iteration
  1109.       strResult = cTruncatePath(File1, 35)
  1110.    Next i
  1111.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1112.    TimerCloseOk = cTimerClose(TimerHandle)
  1113. End Sub
  1114. Private Sub TestMakeSplitPath()
  1115.    Dim intResult        As Integer
  1116.    Dim strResult        As String
  1117.    Dim strDisplay       As String
  1118.    Dim i                As Integer
  1119.    Dim SPLITPATH        As tagSPLITPATH
  1120.    Dim File1            As String
  1121.    strResult = ""
  1122.    strDisplay = ""
  1123.    File1 = cMakePath("c", "\this is a test", "test", "dat")
  1124.    strDisplay = strDisplay & "Make Path of (c,\this is a test,test,dat) is '" & File1 & "'" & vbCrLf & vbCrLf
  1125.    strDisplay = strDisplay & "Split Path '" & File1 & "' into four components is :" & vbCrLf & vbCrLf
  1126.    intResult = cSplitPath(File1, SPLITPATH)
  1127.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDrive & vbCrLf
  1128.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDir & vbCrLf
  1129.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nName & vbCrLf
  1130.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nExt & vbCrLf & vbCrLf
  1131.    txt_Result = strDisplay
  1132.    'time the function
  1133.    TimerHandle = cTimerOpen()
  1134.    TimerStartOk = cTimerStart(TimerHandle)
  1135.    For i = 1 To Iteration
  1136.       strResult = cMakePath("c", "this is a test", "test", "dat")
  1137.    Next i
  1138.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1139.    TimerCloseOk = cTimerClose(TimerHandle)
  1140. End Sub
  1141. Private Sub TestFullPath()
  1142.    Dim intResult        As Integer
  1143.    Dim strResult        As String
  1144.    Dim strDisplay       As String
  1145.    Dim i                As Integer
  1146.    Dim File1            As String
  1147.    strResult = ""
  1148.    strDisplay = ""
  1149.    File1 = T2WFileTest
  1150.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1151.    File1 = cGetSystemDirectory() & "\t2win-32.dll"
  1152.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1153.    File1 = cFilesInDirectory(cGetDefaultCurrentDir() + "\*.*", True)
  1154.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1155.    txt_Result = strDisplay
  1156.    'time the function
  1157.    TimerHandle = cTimerOpen()
  1158.    TimerStartOk = cTimerStart(TimerHandle)
  1159.    For i = 1 To Iteration
  1160.       strResult = cFullPath(File1)
  1161.    Next i
  1162.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1163.    TimerCloseOk = cTimerClose(TimerHandle)
  1164. End Sub
  1165. Private Sub TestRenameFile()
  1166.    Dim intResult        As Integer
  1167.    Dim strResult        As String
  1168.    Dim strDisplay       As String
  1169.    Dim i                As Integer
  1170.    Dim File1            As String
  1171.    Dim File2            As String
  1172.    strResult = ""
  1173.    strDisplay = ""
  1174.    File1 = "this.is.a.test.~~~"
  1175.    File2 = "an another test.---"
  1176.    intResult = cKillFile(File1)
  1177.    intResult = cKillFile(File2)
  1178.    Close #1
  1179.    Open File1 For Output Shared As #1
  1180.    Print #1, File1
  1181.    Print #1, File2
  1182.    Close #1
  1183.    strDisplay = "File '" & File1 & "' " & IIf(cRenameFile(File1, File2) = True, "renamed in '" & File2 & "'", "is not renamed") & vbCrLf & vbCrLf
  1184.    txt_Result = strDisplay
  1185.    'time the function
  1186.    TimerHandle = cTimerOpen()
  1187.    TimerStartOk = cTimerStart(TimerHandle)
  1188.    For i = 1 To Iteration
  1189.       intResult = cRenameFile(File1, File2)
  1190.    Next i
  1191.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1192.    TimerCloseOk = cTimerClose(TimerHandle)
  1193. End Sub
  1194. Public Sub TestUniqueFileName()
  1195.    Dim intResult        As Integer
  1196.    Dim strResult        As String
  1197.    Dim strDisplay       As String
  1198.    Dim i                As Integer
  1199.    Dim File1            As String
  1200.    strResult = ""
  1201.    strDisplay = ""
  1202.    File1 = "WN"
  1203.    strDisplay = strDisplay + "Generate unique filename with template '" & File1 & "' is '" & cUniqueFileName(File1) & "'" & vbCrLf & vbCrLf
  1204.    txt_Result = strDisplay
  1205.    'time the function
  1206.    TimerHandle = cTimerOpen()
  1207.    TimerStartOk = cTimerStart(TimerHandle)
  1208.    For i = 1 To Iteration
  1209.       strResult = cUniqueFileName(File1)
  1210.    Next i
  1211.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1212.    TimerCloseOk = cTimerClose(TimerHandle)
  1213. End Sub
  1214. Private Sub TestFilesInDirectory()
  1215.    Dim intResult        As Integer
  1216.    Dim strResult        As String
  1217.    Dim strDisplay       As String
  1218.    Dim i                As Integer
  1219.    Dim File1            As String
  1220.    strResult = ""
  1221.    strDisplay = ""
  1222.    File1 = "*.*"
  1223.    strDisplay = strDisplay + "The 10 first files in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1224.    strResult = cFilesInDirectory(File1, True)
  1225.    For i = 1 To 10
  1226.       strDisplay = strDisplay & strResult & vbCrLf
  1227.       strResult = cFilesInDirectory(File1, False)
  1228.    Next i
  1229.    strDisplay = strDisplay + vbCrLf
  1230.    File1 = "C:\*.*"
  1231.    strDisplay = strDisplay + "The 10 first files in '" & File1 & "'" & vbCrLf & vbCrLf
  1232.    strResult = cFilesInDirectory(File1, True)
  1233.    For i = 1 To 10
  1234.       strDisplay = strDisplay & strResult & vbCrLf
  1235.       strResult = cFilesInDirectory(File1, False)
  1236.    Next i
  1237.    txt_Result = strDisplay
  1238.    'time the function
  1239.    TimerHandle = cTimerOpen()
  1240.    TimerStartOk = cTimerStart(TimerHandle)
  1241.    For i = 1 To Iteration
  1242.       strResult = cFilesInDirectory(File1, True)
  1243.    Next i
  1244.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1245.    TimerCloseOk = cTimerClose(TimerHandle)
  1246. End Sub
  1247. Private Sub TestSubDirectory()
  1248.    Dim intResult        As Integer
  1249.    Dim strResult        As String
  1250.    Dim strDisplay       As String
  1251.    Dim i                As Integer
  1252.    Dim File1            As String
  1253.    strResult = ""
  1254.    strDisplay = ""
  1255.    File1 = "*.*"
  1256.    strDisplay = strDisplay + "The 10 first directory in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1257.    strResult = cSubDirectory(File1, True)
  1258.    For i = 1 To 10
  1259.       strDisplay = strDisplay & strResult & vbCrLf
  1260.       strResult = cSubDirectory(File1, False)
  1261.    Next i
  1262.    strDisplay = strDisplay + vbCrLf
  1263.    File1 = "C:\*.*"
  1264.    strDisplay = strDisplay + "The 10 first directory in '" & File1 & "'" & vbCrLf & vbCrLf
  1265.    strResult = cSubDirectory(File1, True)
  1266.    For i = 1 To 10
  1267.       strDisplay = strDisplay & strResult & vbCrLf
  1268.       strResult = cSubDirectory(File1, False)
  1269.    Next i
  1270.    txt_Result = strDisplay
  1271.    'time the function
  1272.    TimerHandle = cTimerOpen()
  1273.    TimerStartOk = cTimerStart(TimerHandle)
  1274.    For i = 1 To Iteration
  1275.       strResult = cSubDirectory(File1, True)
  1276.    Next i
  1277.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1278.    TimerCloseOk = cTimerClose(TimerHandle)
  1279. End Sub
  1280. Private Sub TestFileGetAttribute()
  1281.    Dim intResult        As Integer
  1282.    Dim strResult        As String
  1283.    Dim strDisplay       As String
  1284.    Dim i                As Integer
  1285.    Dim File1            As String
  1286.    Dim FileAttrib       As FileAttributeType
  1287.    strResult = ""
  1288.    strDisplay = ""
  1289.    File1 = cFilesInDirectory("*.*", True)
  1290.    intResult = cFileGetAttrib(File1, FileAttrib)
  1291.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1292.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1293.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1294.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1295.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1296.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1297.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1298.      
  1299.    File1 = cGetWindowsDirectory() & "\user.dat"
  1300.    intResult = cFileGetAttrib(File1, FileAttrib)
  1301.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1302.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1303.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1304.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1305.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1306.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1307.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1308.      
  1309.    File1 = cSubDirectory("c:\*.*", True)
  1310.    File1 = cSubDirectory("c:\*.*", False)
  1311.    File1 = cSubDirectory("c:\*.*", False)
  1312.    File1 = "c:\" & File1
  1313.    intResult = cFileGetAttrib(File1, FileAttrib)
  1314.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1315.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1316.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1317.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1318.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1319.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1320.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1321.      
  1322.    txt_Result = strDisplay
  1323.    'time the function
  1324.    TimerHandle = cTimerOpen()
  1325.    TimerStartOk = cTimerStart(TimerHandle)
  1326.    For i = 1 To Iteration
  1327.       intResult = cFileGetAttrib(File1, FileAttrib)
  1328.    Next i
  1329.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1330.    TimerCloseOk = cTimerClose(TimerHandle)
  1331. End Sub
  1332. Private Sub TestFileSetAttribute()
  1333.    Dim intResult        As Integer
  1334.    Dim strResult        As String
  1335.    Dim strDisplay       As String
  1336.    Dim i                As Integer
  1337.    Dim File1            As String
  1338.    Dim FileAttrib       As FileAttributeType
  1339.    strResult = ""
  1340.    strDisplay = ""
  1341.    File1 = cFilesInDirectory("*.*", True)
  1342.    intResult = cFileGetAttrib(File1, FileAttrib)
  1343.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1344.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1345.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1346.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1347.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1348.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1349.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1350.    FileAttrib.Archive = False
  1351.    FileAttrib.Hidden = True
  1352.    FileAttrib.ReadOnly = True
  1353.    FileAttrib.System = True
  1354.    intResult = cFileSetAttrib(File1, FileAttrib)
  1355.    strDisplay = strDisplay & "Setting attribute (not archive, hidden, readonly, system) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1356.      
  1357.    intResult = cFileGetAttrib(File1, FileAttrib)
  1358.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1359.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1360.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1361.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1362.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1363.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1364.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1365.    txt_Result = strDisplay
  1366.    'time the function
  1367.    TimerHandle = cTimerOpen()
  1368.    TimerStartOk = cTimerStart(TimerHandle)
  1369.    For i = 1 To Iteration
  1370.       intResult = cFileSetAttrib(File1, FileAttrib)
  1371.    Next i
  1372.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1373.    TimerCloseOk = cTimerClose(TimerHandle)
  1374. End Sub
  1375. Private Sub TestFileSetAllAttributes()
  1376.    Dim intResult        As Integer
  1377.    Dim strResult        As String
  1378.    Dim strDisplay       As String
  1379.    Dim i                As Integer
  1380.    Dim File1            As String
  1381.    Dim FileAttrib       As FileAttributeType
  1382.    strResult = ""
  1383.    strDisplay = ""
  1384.    File1 = cFilesInDirectory("*.*", True)
  1385.    intResult = cFileGetAttrib(File1, FileAttrib)
  1386.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1387.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1388.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1389.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1390.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1391.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1392.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1393.    intResult = cFileSetAllAttrib(File1)
  1394.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1395.      
  1396.    intResult = cFileGetAttrib(File1, FileAttrib)
  1397.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1398.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1399.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1400.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1401.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1402.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1403.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1404.    txt_Result = strDisplay
  1405.    'time the function
  1406.    TimerHandle = cTimerOpen()
  1407.    TimerStartOk = cTimerStart(TimerHandle)
  1408.    For i = 1 To Iteration
  1409.       intResult = cFileSetAllAttrib(File1)
  1410.    Next i
  1411.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1412.    TimerCloseOk = cTimerClose(TimerHandle)
  1413. End Sub
  1414. Public Sub TestFileResetAllAttributes()
  1415.    Dim intResult        As Integer
  1416.    Dim strResult        As String
  1417.    Dim strDisplay       As String
  1418.    Dim i                As Integer
  1419.    Dim File1            As String
  1420.    Dim FileAttrib       As FileAttributeType
  1421.    strResult = ""
  1422.    strDisplay = ""
  1423.    File1 = cFilesInDirectory("*.*", True)
  1424.    intResult = cFileGetAttrib(File1, FileAttrib)
  1425.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1426.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1427.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1428.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1429.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1430.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1431.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1432.    intResult = cFileResetAllAttrib(File1)
  1433.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1434.      
  1435.    intResult = cFileGetAttrib(File1, FileAttrib)
  1436.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1437.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1438.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1439.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1440.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1441.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1442.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1443.    txt_Result = strDisplay
  1444.    'time the function
  1445.    TimerHandle = cTimerOpen()
  1446.    TimerStartOk = cTimerStart(TimerHandle)
  1447.    For i = 1 To Iteration
  1448.       intResult = cFileResetAllAttrib(File1)
  1449.    Next i
  1450.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1451.    TimerCloseOk = cTimerClose(TimerHandle)
  1452. End Sub
  1453. Public Sub TestFileCompareX()
  1454.    Dim intResult        As Integer
  1455.    Dim strResult        As String
  1456.    Dim strDisplay       As String
  1457.    Dim i                As Integer
  1458.    Dim File1            As String
  1459.    Dim File2            As String
  1460.    Dim FileAttrib       As FileAttributeType
  1461.    strResult = ""
  1462.    strDisplay = ""
  1463.    File1 = T2WFileTest
  1464.    File2 = "autoexec.compare"
  1465.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  1466.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1467.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1468.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1469.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1470.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1471.      
  1472.    Close #1
  1473.    Open File2 For Append Shared As #1
  1474.    Print #1, File2
  1475.    Close #1
  1476.      
  1477.    strDisplay = strDisplay & "Appending " & (Len(File2) + 2) & " chars to '" & File2 & "'" & vbCrLf & vbCrLf
  1478.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1479.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1480.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1481.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1482.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1483.      
  1484.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) is " & cFileResetAllAttrib(File2) & vbCrLf & vbCrLf
  1485.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1486.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1487.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1488.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1489.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1490.      
  1491.    txt_Result = strDisplay
  1492.    'time the function
  1493.    TimerHandle = cTimerOpen()
  1494.    TimerStartOk = cTimerStart(TimerHandle)
  1495.    For i = 1 To Iteration
  1496.       intResult = cCmpFileSize(File1, File2)
  1497.    Next i
  1498.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1499.    TimerCloseOk = cTimerClose(TimerHandle)
  1500. End Sub
  1501. Private Sub TestFileDrive()
  1502.    Dim intResult        As Integer
  1503.    Dim strResult        As String
  1504.    Dim strDisplay       As String
  1505.    Dim i                As Integer
  1506.    Dim File1            As String
  1507.    strResult = ""
  1508.    strDisplay = ""
  1509.    File1 = T2WFileTest
  1510.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  1511.    File1 = cGetWindowsDirectory() + "\user.dat"
  1512.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  1513.    txt_Result = strDisplay
  1514.    'time the function
  1515.    TimerHandle = cTimerOpen()
  1516.    TimerStartOk = cTimerStart(TimerHandle)
  1517.    For i = 1 To Iteration
  1518.       strResult = cFileDrive(File1)
  1519.    Next i
  1520.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1521.    TimerCloseOk = cTimerClose(TimerHandle)
  1522. End Sub
  1523. Private Sub TestFilesInDirOnDisk()
  1524.    Dim lngResult        As Long
  1525.    Dim strResult        As String
  1526.    Dim strDisplay       As String
  1527.    Dim i                As Integer
  1528.    Dim File1            As String
  1529.    Dim File2            As String
  1530.    strResult = ""
  1531.    strDisplay = ""
  1532.    File1 = "filesindirondisk.temp"
  1533.    File2 = "c:\*.*"
  1534.    strDisplay = strDisplay & "Number of files '" & File2 & "' (with at least one of the following attribute)" & vbCrLf & vbCrLf
  1535.    strDisplay = strDisplay & "Any : " & cFilesInDirOnDisk(File1, File2, A_ALL) & vbCrLf
  1536.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL) & vbCrLf
  1537.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL_ARCHIVE) & vbCrLf
  1538.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE) & vbCrLf
  1539.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE Or A_RDONLY) & vbCrLf
  1540.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_SYSTEM Or A_HIDDEN Or A_RDONLY) & vbCrLf
  1541.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_HIDDEN Or A_RDONLY) & vbCrLf
  1542.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_RDONLY) & vbCrLf
  1543.    strDisplay = strDisplay & vbCrLf
  1544.    strDisplay = strDisplay & "Number of files in '" & File2 & "' (with exact attribute excluding all others)" & vbCrLf & vbCrLf
  1545.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL)) & vbCrLf
  1546.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL_ARCHIVE)) & vbCrLf
  1547.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE)) & vbCrLf
  1548.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE Or A_RDONLY)) & vbCrLf
  1549.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  1550.    strDisplay = strDisplay & "(A)rchive, (S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL Or A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  1551.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_HIDDEN Or A_RDONLY)) & vbCrLf
  1552.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_RDONLY)) & vbCrLf
  1553.    strDisplay = strDisplay & vbCrLf
  1554.    txt_Result = strDisplay
  1555.    'time the function
  1556.    TimerHandle = cTimerOpen()
  1557.    TimerStartOk = cTimerStart(TimerHandle)
  1558.    For i = 1 To Iteration
  1559.       lngResult = cFilesInDirOnDisk(File1, File2, A_ALL)
  1560.    Next i
  1561.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1562.    TimerCloseOk = cTimerClose(TimerHandle)
  1563. End Sub
  1564. Private Sub TestFileDateTime()
  1565.    Dim intResult        As Integer
  1566.    Dim strResult        As String
  1567.    Dim strDisplay       As String
  1568.    Dim i                As Integer
  1569.    Dim File1            As String
  1570.    strResult = ""
  1571.    strDisplay = ""
  1572.    File1 = T2WFileTest
  1573.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1574.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1575.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1576.    File1 = "c:\config.sys"
  1577.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1578.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1579.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1580.    File1 = cGetSystemDirectory() + "\t2win-32.dll"
  1581.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1582.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1583.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1584.    File1 = cGetWindowsDirectory() + "\user.dat"
  1585.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1586.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1587.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1588.    txt_Result = strDisplay
  1589.    'time the function
  1590.    TimerHandle = cTimerOpen()
  1591.    TimerStartOk = cTimerStart(TimerHandle)
  1592.    For i = 1 To Iteration
  1593.       strResult = cFileDateCreated(File1)
  1594.    Next i
  1595.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1596.    TimerCloseOk = cTimerClose(TimerHandle)
  1597. End Sub
  1598. Private Sub TestFileStatistics()
  1599.    Dim lngResult        As Long
  1600.    Dim strResult        As String
  1601.    Dim strDisplay       As String
  1602.    Dim i                As Integer
  1603.    Dim nL               As Long
  1604.    Dim nW               As Long
  1605.    Dim nC               As Long
  1606.    Dim File1            As String
  1607.    strResult = ""
  1608.    strDisplay = ""
  1609.    File1 = T2WFileTest
  1610.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  1611.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  1612.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  1613.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  1614.    File1 = "c:\config.sys"
  1615.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  1616.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  1617.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  1618.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  1619.    txt_Result = strDisplay
  1620.    'time the function
  1621.    TimerHandle = cTimerOpen()
  1622.    TimerStartOk = cTimerStart(TimerHandle)
  1623.    For i = 1 To Iteration
  1624.       lngResult = cFileStatistics(File1, nL, nW, nC)
  1625.    Next i
  1626.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1627.    TimerCloseOk = cTimerClose(TimerHandle)
  1628. End Sub
  1629. Private Sub TestGetDriveType()
  1630.    Dim intResult        As Integer
  1631.    Dim strResult        As String
  1632.    Dim strDisplay       As String
  1633.    Dim i                As Integer
  1634.    strResult = ""
  1635.    strDisplay = ""
  1636.    For i = 1 To 26
  1637.       intResult = cGetDriveType(Chr$(64 + i))
  1638.       If (intResult > 0) Then
  1639.          strDisplay = strDisplay & "'" & Chr$(64 + i) & ":' is "
  1640.          Select Case intResult
  1641.             Case DRIVE_UNKNOWN
  1642.                strDisplay = strDisplay & "(unknown)" & vbCrLf
  1643.             Case DRIVE_NO_ROOT_DIR
  1644.                strDisplay = strDisplay & "(not root dir)" & vbCrLf
  1645.             Case DRIVE_REMOVABLE
  1646.                strDisplay = strDisplay & "removable" & vbCrLf
  1647.             Case DRIVE_FIXED
  1648.                strDisplay = strDisplay & "fixed disk" & vbCrLf
  1649.             Case DRIVE_REMOTE
  1650.                strDisplay = strDisplay & "remote disk" & vbCrLf
  1651.             Case DRIVE_CDROM
  1652.                strDisplay = strDisplay & "cd-rom" & vbCrLf
  1653.             Case DRIVE_RAMDISK
  1654.                strDisplay = strDisplay & "ram disk" & vbCrLf
  1655.          End Select
  1656.       End If
  1657.    Next i
  1658.      
  1659.    txt_Result = strDisplay
  1660.    'time the function
  1661.    TimerHandle = cTimerOpen()
  1662.    TimerStartOk = cTimerStart(TimerHandle)
  1663.    For i = 1 To Iteration
  1664.       intResult = cGetDriveType("C")
  1665.    Next i
  1666.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1667.    TimerCloseOk = cTimerClose(TimerHandle)
  1668. End Sub
  1669. Private Sub TestPBFileCopy()
  1670.    Dim intResult        As Long
  1671.    Dim strResult        As String
  1672.    Dim strDisplay       As String
  1673.    Dim i                As Long
  1674.    Dim File1            As String
  1675.    Dim File2            As String
  1676.    strResult = ""
  1677.    strDisplay = ""
  1678.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  1679.    File2 = "system.pbcopy"
  1680.    strDisplay = strDisplay & "PB File Copy '" & File1 & "' to '" & File2 & "' is " & cPBFileCopy(Me.hWnd, File1, File2) & vbCrLf & vbCrLf
  1681.    txt_Result = strDisplay
  1682.    'time the function
  1683.       
  1684.    DoEvents
  1685.    TimerHandle = cTimerOpen()
  1686.    TimerStartOk = cTimerStart(TimerHandle)
  1687.    For i = 1 To Iteration
  1688.       intResult = cPBFileCopy(Me.hWnd, File1, File2)
  1689.       DoEvents
  1690.    Next i
  1691.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1692.    TimerCloseOk = cTimerClose(TimerHandle)
  1693. End Sub
  1694. Private Sub TestDBFileCopy()
  1695.    Dim intResult        As Integer
  1696.    Dim strResult        As String
  1697.    Dim strDisplay       As String
  1698.    Dim i                As Long
  1699.    Dim File1            As String
  1700.    Dim File2            As String
  1701.    strResult = ""
  1702.    strDisplay = ""
  1703.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  1704.    File2 = "system.dbcopy"
  1705.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  1706.    File1 = cGetWindowsDirectory() + "\" + "command.com"
  1707.    File2 = "command.dbcopy"
  1708.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  1709.    txt_Result = strDisplay
  1710.    'time the function
  1711.    DoEvents
  1712.    TimerHandle = cTimerOpen()
  1713.    TimerStartOk = cTimerStart(TimerHandle)
  1714.    For i = 1 To Iteration
  1715.       intResult = cDBFileCopy("", "", "", "", File1, File2)
  1716.       DoEvents
  1717.    Next i
  1718.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1719.    TimerCloseOk = cTimerClose(TimerHandle)
  1720. End Sub
  1721. Private Sub TestFileUUCP()
  1722.    Dim lngResult        As Long
  1723.    Dim strResult        As String
  1724.    Dim strDisplay       As String
  1725.    Dim i                As Integer
  1726.    Dim File1            As String
  1727.    Dim File2            As String
  1728.    Dim File3            As String
  1729.    strResult = ""
  1730.    strDisplay = ""
  1731.    File1 = "c:\win95\system.dat"
  1732.    File2 = "system.uuencoded"
  1733.    File3 = "system.uudecoded"
  1734.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  1735.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  1736.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  1737.    File1 = T2WFileTest
  1738.    File2 = "autoexec.uuencoded"
  1739.    File3 = "autoexec.uudecoded"
  1740.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  1741.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  1742.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  1743.    txt_Result = strDisplay
  1744.    'time the function
  1745.    TimerHandle = cTimerOpen()
  1746.    TimerStartOk = cTimerStart(TimerHandle)
  1747.    For i = 1 To Iteration
  1748.       lngResult = cFileUUCP(File1, File2, MODE_UUENCODE)
  1749.    Next i
  1750.    lngResult = cFileUUCP(File2, File3, MODE_UUDECODE)
  1751.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1752.    TimerCloseOk = cTimerClose(TimerHandle)
  1753. End Sub
  1754. Private Sub TestOpenFiles(Mode As Integer)
  1755.    Dim intResult        As Integer
  1756.    Dim OpenFileName     As String
  1757.    Dim OpenFileMode     As Long
  1758.    Dim OpenFileType     As Long
  1759.    Dim strDisplay       As String
  1760.    Dim i                As Long
  1761.    strDisplay = ""
  1762.    i = -1
  1763.    TimerHandle = cTimerOpen()
  1764.    TimerStartOk = cTimerStart(TimerHandle)
  1765.    intResult = cEnumOpenFiles("C", Mode, True, OpenFileName, OpenFileMode, OpenFileType)
  1766.    strDisplay = "All open files on drive C are " & vbCrLf & vbCrLf
  1767.    While (intResult = NO_ERROR_OPEN_FILES)
  1768.       strDisplay = strDisplay + OpenFileName + " , " & OpenFileMode & " , " & OpenFileType & vbCrLf
  1769.       intResult = cEnumOpenFiles("C", Mode, False, OpenFileName, OpenFileMode, OpenFileType)
  1770.    Wend
  1771.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1772.    TimerCloseOk = cTimerClose(TimerHandle)
  1773.    txt_Result = strDisplay
  1774. End Sub
  1775.